﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX.Direct3D;
using Microsoft.DirectX;
using System.Diagnostics;

namespace DirectX_CS
{
    public class LightListItem
        {
            private Device mDevice;

            public Device Device
            {
                get { return mDevice; }
                set { mDevice = value; }
            }

            public LightListItem()
            {
            }
            public LightListItem(Device device, int lightNumber)
            {
                mDevice = device;
                mLightIndex = lightNumber;
                //mLight = device.Lights[lightNumber];

				mText = "Light " + lightNumber.ToString();
				// + " " +mDevice.Lights[lightNumber].Type.ToString();
					// +(this.Enabled ? "(Enabled)" : "(Disabled)");
            }
            int mLightIndex;
            public int LightIndex
            {
                get { return mLightIndex; }
                set { mLightIndex = value; }
            }

            //private Light mLight;
            public Light Light
            {
                get { return mDevice.Lights[LightIndex]; }
            }

            private string mText;
            public string Text
            {
                get { return mText; }//+ (Light.Enabled ? "*" : "")
                set { mText = value; }
            }
            public bool Enabled
            {
                get { return Light.Enabled; }
                set
                {
                    Light.Enabled = value;
                    Light.Update();
                }
            }
        } //end of class

    public class LightList : List<LightListItem>
    {

        //List<LightListItem> lightList = new List<LightListItem>();
        public LightList(Device device)
        {
            for (int lIdx = 0; lIdx < device.Lights.Count; lIdx++)
            {
                this.Add(new LightListItem(device, lIdx));
            }

        }

    }

    public class LightTypeListItem
    {
        LightType mType;

        public LightType LightType
        {
            get { return mType; }
            set { mType = value; }
        }
        public LightTypeListItem(LightType type)
        {
            mType = type;
        }
        public int iValue
        {
            get { return (int)mType; }
        }
        public string sValue
        {
            get { return mType.ToString(); }
        }
    }

    public class LightTypeList : List<LightTypeListItem>
    {
        public LightTypeList()
        {
            this.Add(new LightTypeListItem(LightType.Directional));
            this.Add(new LightTypeListItem(LightType.Point));
            this.Add(new LightTypeListItem(LightType.Spot));
        }
    }


}
